﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Remoting.Messaging;

namespace Xss.Data.Common.SessionStore
{
    public class CallContextSessionStore : SessionStore
    {
        public CallContextSessionStore(string id)
            : base(id)
        {

        }

        public override IAdoSession CurrentSession
        {
            get { return (IAdoSession)CallContext.GetData(sessionName); }
        }

        public override void Store(IAdoSession session)
        {
            CallContext.SetData(sessionName, session);
        }

        public override void Release()
        {
            CallContext.SetData(sessionName, null);
        }
    }
}
